home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1462.dms / var1462.adf / REXX / TextFax.rexx < prev   
OS/2 REXX Batch file  |  1994-04-17  |  809b  |  46 lines

  1. /*
  2.  * TextFax.rexx
  3.  * D. Varley, C-Born Software Systems
  4.  * 14FEB94
  5.  *
  6.  * Synopsis:
  7.  *    Example Rexx script to convert text->fax and call afax
  8.  *    Written in response to query from Krzysztof Adamski
  9.  *    This is just a quick demo, and could easily be jazzed up!
  10.  *
  11.  * Use:
  12.  *    TextFax FaxFile
  13.  *
  14.  */
  15. options results
  16.  
  17. /* trace results */    /* uncomment this line to debug */
  18.  
  19.  
  20. address command
  21.  
  22. parse arg file user
  23.  
  24. /* do some error checking */
  25. if file == "" then do
  26.     say "Usage: TextFax textfile"
  27.     exit(999)
  28. end
  29.  
  30. /* Get Fax-file name */
  31.  
  32. sfnum = 0;
  33. do sfnum = 0 to 1000
  34.     sfname = "FAXSPOOL:S_"||sfnum||".AFX"
  35.     if ~exists(sfname) then leave
  36.     if sfnum >= 999 then do
  37.         say "Error: Can't get fax file"
  38.         exit(999)
  39.     end
  40. end
  41.  
  42. address command "afax:c/mkafax "||file||" "||sfname
  43. address command "afax:c/afax -f "||sfname
  44.  
  45.  
  46.